<?php require_once('../Connections/miportal.php');
mysql_query("SET NAMES 'utf8'"); ?>


<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}





mysql_select_db($database_miportal, $miportal);
$query_rs_can_mpe = "SELECT id_cor_candidato,nb_primaria, nb_nom_nombre1, nb_nom_nombre2, nb_nom_apaterno, nb_nom_amaterno, ties_titulo, ties_nombre_completo, ac_carrera, id_cat_primaria, id_cve_sep,   tp_status_validacion,tp_status_rev, tp_status_eval, id_nmbNombre FROM asignacion_mpe WHERE tp_status_validacion=1 AND id_cat_convocatoria=20";
$rs_can_mpe = mysql_query($query_rs_can_mpe, $miportal) or die(mysql_error());
$row_rs_can_mpe = mysql_fetch_assoc($rs_can_mpe);
$totalRows_rs_can_mpe = mysql_num_rows($rs_can_mpe);

//CANDIDATOS

mysql_select_db($database_miportal, $miportal);
$query_rs_can = "SELECT COUNT(*)FROM asignacion_mpe WHERE tp_status_validacion=1 AND id_cat_convocatoria=20;";
$rs_can = mysql_query($query_rs_can, $miportal);
$totalRows_rs_can= mysql_result($rs_can,0);


/*CANDIDATOS VALIDADOS*/
mysql_select_db($database_miportal, $miportal);
$query_rs_rev = "SELECT COUNT(*) FROM asignacion_mpe WHERE tp_status_validacion=1 AND tp_status_rev<>0 AND `id_cat_convocatoria`=20;";
$rs_rev = mysql_query($query_rs_rev, $miportal);
$totalRows_rs_rev = mysql_result($rs_rev,0);

/*CANDIDATOS REVISADOS Y CUMPLE*/
mysql_select_db($database_miportal, $miportal);
$query_rs_revcumple = "SELECT COUNT(*) FROM asignacion_mpe WHERE tp_status_validacion=1 AND tp_status_rev=1 AND `id_cat_convocatoria`=20;";
$rs_revcumple = mysql_query($query_rs_revcumple, $miportal);
$totalRows_rs_revcumple = mysql_result($rs_revcumple,0);

/*EVALUADOS QUE CUMPLEN*/
mysql_select_db($database_miportal, $miportal);
$query_rs_eval = "SELECT COUNT(*) FROM asignacion_mpe WHERE tp_status_validacion=1 AND tp_status_rev=1 AND tp_status_eval=1 AND `id_cat_convocatoria`=20";
$rs_eval = mysql_query($query_rs_eval, $miportal);
$totalRows_rs_eval = mysql_result($rs_eval,0);

/*CUMPLEN CON TODO*/
mysql_select_db($database_miportal, $miportal);
$query_rs_cumpletodo = "SELECT COUNT(*) FROM asignacion_mpe WHERE tp_status_validacion=1 AND tp_status_rev=1 AND tp_status_eval=1 AND `id_cat_convocatoria`=20";
$rs_cumpletodo = mysql_query($query_rs_cumpletodo, $miportal);
$totalRows_rs_cumpletodo = mysql_result($rs_cumpletodo,0);





?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximun-scale=1">
<title>FUNDACIÓN EDUCACIÓN SUPERIOR-EMPRESA</title>
<!--Hoja de estilo principal-->
<link href="../css/styletd2.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="stylesheet/img/devil-icon.png"> 
<link rel="stylesheet" type="text/css" href="../css/mos-style.css">
<link rel="stylesheet" type="text/css" href="../css/menu.css"><!--Pemanggilan gambar favicon-->
 <!--pemanggilan file css-->
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<script language=""="JavaScript">
	function confirmar ( mensaje ) {
					return confirm( mensaje );
				}
        </script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
</head>
<body>
 <header>
    <div id="background"></div><!--BackGround Menu header-->
		<div class="img_header_logo"></div>
		<span class="img_header_logo"><a href="http://fese.org.mx"><img src="../images/fese/FESE_home_logo.png"  height="90" alt="FESE" align="bottom" /></a></span>
		<div class="img_header_logo"></div>
		
        <div id="nav">
		<ul>
		  <li class="nivel1"><a href="../report/report_can_exp.php" class="nivel1">EXPERIMENTA</a></li>
		  <li class="nivel1"><a href="../report/report_can_emp.php" class="nivel1">EMPLEATE</a></li>
          <li class="nivel1"><a href="../report/report_can_bv.php" class="nivel1">BVINCULACIÓN</a></li> 
		   <li class="nivel1"><a href="../report/report_can_mpe.php" class="nivel1">MPE</a></li>
		</ul>
</div><!--Menu NAV-->
        
        
</header>
<center>
<div id="boxcontainer">
<div id="container">


<table width="120%" cellspacing="0" style="margin-left:80px; >

<tr class="data">      
      
      <th class="data">CANDIDATOS PROPUESTOS</th>
      <th class="data">REVISADOS</th>
      <th class="data">REVISADOS COMPLETOS</th>
      <th class="data">EVALUADOS</th>
      <th class="data">CUMPLEN</th>
</tr>

  <tr>  
    <td class="data"><?php echo $totalRows_rs_can;?></td>  
    <td class="data"><?php echo $totalRows_rs_rev;?></td>  
    <td class="data"><?php echo $totalRows_rs_revcumple;?></td> 
	<td class="data"><?php echo $totalRows_rs_eval;?></td> 
	<td class="data"><?php echo $totalRows_rs_cumpletodo;?></td> 
   </tr>
</table>

<br>
<br>



  <table width="120%" cellspacing="0" style="margin-left:80px;>
  
  <tr>      
      <th class="data"></th>
      <th class="data">FOLIO</th>
      <th class="data">NOMBRE CANDIDATO</th>
      <th class="data">CARRERA</th>
      <th class="data">IES</th>
      <th class="data">FOLIO PRIMARIA</th>
      <th class="data">PRIMARIA </th>
      <th class="data">CLAVE SEP</th>
      <th class="data">REVISADOS</th>
	  <th class="data">EVALUADOS</th>
      <th class="data">CUMPLE TODO</th>
    </tr>
    
     <?php do { ?>
    
    <tr>
    <td class="data"><?php echo "MPE".str_pad($row_rs_can_mpe['id_cor_candidato'],4,0, STR_PAD_LEFT)."13"; ?></td>
    <td class="data"><?php echo $row_rs_can_mpe['nb_nom_nombre1'];?> <?php echo $row_rs_can_mpe['nb_nom_nombre2'];?> <?php echo $row_rs_can_mpe['nb_nom_apaterno'];?> <?php echo $row_rs_can_mpe['nb_nom_amaterno'];?></td>
    <td class="data"><?php echo $row_rs_can_mpe['ac_carrera']; ?></td>
    <td class="data"><?php echo $row_rs_can_mpe['id_nmbNombre']; ?></td>
    <td class="data"><?php echo $row_rs_can_mpe['id_cat_primaria']; ?></td>
    <td class="data"><?php echo $row_rs_can_mpe['nb_primaria']; ?></td>
    <td class="data"><?php echo $row_rs_can_mpe['id_cve_sep']; ?></td>
    
    
       
    
	<td class="data">
	
	<?php
	if($row_rs_can_mpe['tp_status_rev']==1){
	
	echo "<span style=color:#0097A9>COMPLETO</span>";
	
	} else if($row_rs_can_mpe['tp_status_rev']==-1){
	
	echo "<span style=color:#A9001B>INCOMPLETO</span>";
	
	}
	
	
	
	?>
	
	</td>
   
	
	<td class="data">
	
	<?php
	if($row_rs_can_mpe['tp_status_eval']==1){
	
	echo "<span style=color:#0097A9>CUMPLE</span>";
	
	} else if($row_rs_can_mpe['tp_status_eval']==-1){
	
	echo "<span style=color:#A9001B>NO CUMPLE</span>";
	
	}
	
	
	
	?>
	</td>
    
    
     <td class="data">
	
	<?php
	if($row_rs_can_mpe['tp_status_eval']==1 && $row_rs_can_mpe['tp_status_rev']==1){
	
	echo "<span style=color:#0097A9>CUMPLE</span>";
	
	} else if($row_rs_can_mpe['tp_status_rev']==-1 || $row_rs_can_mpe['tp_status_eval']==-1){
	
	echo "<span style=color:#A9001B>NO CUMPLE</span>";
	
	
	}
	
	?>
	</td>
    
    
    </tr>
    <?php } while ($row_rs_can_mpe = mysql_fetch_assoc($rs_can_mpe)); ?>
  
  
</table>

 
  
  <p>&nbsp;</p>
<p>&nbsp;</p>
  <p>&nbsp;</p>
  <div id="dinamicContaint">
  
  </div><!--dinamicContaint-->
  <p>&nbsp;</p>
</div><!--Container-->



</div><!--Boxcontainer-->
</center>
  
  
</body></html>
